﻿using FunArts.EasyDevOps.Shared.Models.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace FunArts.EasyDevOps.Shared.Models.SshClient.Command
{
    /// <summary>
    /// 查找文件命令
    /// </summary>
    public class FindCommand: ILinuxCommand
    {
        /// <summary>
        /// 查找目录
        /// </summary>
        public string Directory { get; set; } 
        /// <summary>
        /// 文件名
        /// </summary>
        public string FileName { get; set; } 

        public FindCommand(string fileName, string directory = ".")
        {
            FileName = fileName;
            Directory = directory;
        }

        public string BuildCommand(SystemVersionTypeEnum systemVersionType)
        {
            return $"find {Directory} -name {FileName}";

        }
    }
}
